import React,{Component} from 'react';
import './follow.css';
import HdbCell from "../../components/hdb-cell";
import {queryFollow} from "../../services/product";

export default class  Follow extends Component{
    state={
        follow:[]
    };

    async componentDidMount(){
        let res = await queryFollow();
        this.setState({follow:res.data.data})
    }
    render(){
        let {follow} = this.state;
        return (
            <div className="container">
                {
                    follow.map((item,index)=>(
                        <HdbCell
                            key={item.id}
                            index={index}
                            title={item.title}
                            label={item.des}
                            to={{pathname:`/detail/${item.id}`,search:{apiname:'follow'}}}
                        />
                    ))
                }
            </div>
        )
    }
}